package test4;

import java.util.Scanner;

public class test4_6_2 {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();
		String[] str = new String[n];
		String[] str2 = new String[n];
		int a = 0;
		/*for(int i=0;i<n;i++){
			str[i] = sc.next();
		}*/
		for(int i=0;i<n;i++){
			switch (sc.next()) {
			case "c":
				Computer c = new Computer();
				str2[a]=c.toString();
				a++;
				break;
			case "d":
				//String d = sc.next();
				Double d1 = new Double(sc.next());
				str2[a] = d1.toString();
				
				a++;
				break;
			case "i":
				//String s = sc.next();
				Integer s1 = new Integer(sc.next());
				str2[a] = s1.toString();
				
				a++;
				break;
			case "s":
				String z = sc.next();
				str2[a]=z;
				a++;
				break;
			

			default:
				str2[a]="null";
				a++;

				break;
			}

		}
		a--;
		for(int i=n-1;i>=0;i--){
			if(str2[i]!="null")
			System.out.println(str2[i]);
		}

	    sc.close();
	}

}
